// $ANTLR 3.3 Nov 30, 2010 12:50:56 /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g 2012-03-05 13:34:45

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class CalcLexer extends Lexer {
    public static final int EOF=-1;
    public static final int T__7=7;
    public static final int T__8=8;
    public static final int T__9=9;
    public static final int T__10=10;
    public static final int T__11=11;
    public static final int T__12=12;
    public static final int T__13=13;
    public static final int T__14=14;
    public static final int NEWLINE=4;
    public static final int Number=5;
    public static final int WHITESPACE=6;

    // delegates
    // delegators

    public CalcLexer() {;} 
    public CalcLexer(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public CalcLexer(CharStream input, RecognizerSharedState state) {
        super(input,state);

    }
    public String getGrammarFileName() { return "/home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g"; }

    // $ANTLR start "T__7"
    public final void mT__7() throws RecognitionException {
        try {
            int _type = T__7;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:3:6: ( '+' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:3:8: '+'
            {
            match('+'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__7"

    // $ANTLR start "T__8"
    public final void mT__8() throws RecognitionException {
        try {
            int _type = T__8;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:4:6: ( 'sin' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:4:8: 'sin'
            {
            match("sin"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__8"

    // $ANTLR start "T__9"
    public final void mT__9() throws RecognitionException {
        try {
            int _type = T__9;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:5:6: ( 'cos' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:5:8: 'cos'
            {
            match("cos"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__9"

    // $ANTLR start "T__10"
    public final void mT__10() throws RecognitionException {
        try {
            int _type = T__10;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:6:7: ( 'pi' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:6:9: 'pi'
            {
            match("pi"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__10"

    // $ANTLR start "T__11"
    public final void mT__11() throws RecognitionException {
        try {
            int _type = T__11;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:7:7: ( 'pow' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:7:9: 'pow'
            {
            match("pow"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__11"

    // $ANTLR start "T__12"
    public final void mT__12() throws RecognitionException {
        try {
            int _type = T__12;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:8:7: ( 'mult' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:8:9: 'mult'
            {
            match("mult"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__12"

    // $ANTLR start "T__13"
    public final void mT__13() throws RecognitionException {
        try {
            int _type = T__13;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:9:7: ( '(' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:9:9: '('
            {
            match('('); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__13"

    // $ANTLR start "T__14"
    public final void mT__14() throws RecognitionException {
        try {
            int _type = T__14;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:10:7: ( ')' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:10:9: ')'
            {
            match(')'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "T__14"

    // $ANTLR start "Number"
    public final void mNumber() throws RecognitionException {
        try {
            int _type = Number;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:3: ( ( '0' .. '9' )+ ( '.' ( '0' .. '9' )+ )? )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:5: ( '0' .. '9' )+ ( '.' ( '0' .. '9' )+ )?
            {
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:5: ( '0' .. '9' )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0>='0' && LA1_0<='9')) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:6: '0' .. '9'
            	    {
            	    matchRange('0','9'); 

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);

            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:19: ( '.' ( '0' .. '9' )+ )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0=='.') ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:20: '.' ( '0' .. '9' )+
                    {
                    match('.'); 
                    // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:24: ( '0' .. '9' )+
                    int cnt2=0;
                    loop2:
                    do {
                        int alt2=2;
                        int LA2_0 = input.LA(1);

                        if ( ((LA2_0>='0' && LA2_0<='9')) ) {
                            alt2=1;
                        }


                        switch (alt2) {
                    	case 1 :
                    	    // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:29:25: '0' .. '9'
                    	    {
                    	    matchRange('0','9'); 

                    	    }
                    	    break;

                    	default :
                    	    if ( cnt2 >= 1 ) break loop2;
                                EarlyExitException eee =
                                    new EarlyExitException(2, input);
                                throw eee;
                        }
                        cnt2++;
                    } while (true);


                    }
                    break;

            }


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "Number"

    // $ANTLR start "WHITESPACE"
    public final void mWHITESPACE() throws RecognitionException {
        try {
            int _type = WHITESPACE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:33:3: ( ( ' ' | '\\t' )+ )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:33:5: ( ' ' | '\\t' )+
            {
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:33:5: ( ' ' | '\\t' )+
            int cnt4=0;
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0=='\t'||LA4_0==' ') ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:
            	    {
            	    if ( input.LA(1)=='\t'||input.LA(1)==' ' ) {
            	        input.consume();

            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;}


            	    }
            	    break;

            	default :
            	    if ( cnt4 >= 1 ) break loop4;
                        EarlyExitException eee =
                            new EarlyExitException(4, input);
                        throw eee;
                }
                cnt4++;
            } while (true);

            this.skip();

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "WHITESPACE"

    // $ANTLR start "NEWLINE"
    public final void mNEWLINE() throws RecognitionException {
        try {
            int _type = NEWLINE;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:37:9: ( '\\n' )
            // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:37:11: '\\n'
            {
            match('\n'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
    // $ANTLR end "NEWLINE"

    public void mTokens() throws RecognitionException {
        // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:8: ( T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | Number | WHITESPACE | NEWLINE )
        int alt5=11;
        alt5 = dfa5.predict(input);
        switch (alt5) {
            case 1 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:10: T__7
                {
                mT__7(); 

                }
                break;
            case 2 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:15: T__8
                {
                mT__8(); 

                }
                break;
            case 3 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:20: T__9
                {
                mT__9(); 

                }
                break;
            case 4 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:25: T__10
                {
                mT__10(); 

                }
                break;
            case 5 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:31: T__11
                {
                mT__11(); 

                }
                break;
            case 6 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:37: T__12
                {
                mT__12(); 

                }
                break;
            case 7 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:43: T__13
                {
                mT__13(); 

                }
                break;
            case 8 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:49: T__14
                {
                mT__14(); 

                }
                break;
            case 9 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:55: Number
                {
                mNumber(); 

                }
                break;
            case 10 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:62: WHITESPACE
                {
                mWHITESPACE(); 

                }
                break;
            case 11 :
                // /home/ubuntu/kenpu-teaching/201201/csci4020u/03-antlr-calculator/src/Calc.g:1:73: NEWLINE
                {
                mNEWLINE(); 

                }
                break;

        }

    }


    protected DFA5 dfa5 = new DFA5(this);
    static final String DFA5_eotS =
        "\15\uffff";
    static final String DFA5_eofS =
        "\15\uffff";
    static final String DFA5_minS =
        "\1\11\3\uffff\1\151\10\uffff";
    static final String DFA5_maxS =
        "\1\163\3\uffff\1\157\10\uffff";
    static final String DFA5_acceptS =
        "\1\uffff\1\1\1\2\1\3\1\uffff\1\6\1\7\1\10\1\11\1\12\1\13\1\4\1\5";
    static final String DFA5_specialS =
        "\15\uffff}>";
    static final String[] DFA5_transitionS = {
            "\1\11\1\12\25\uffff\1\11\7\uffff\1\6\1\7\1\uffff\1\1\4\uffff"+
            "\12\10\51\uffff\1\3\11\uffff\1\5\2\uffff\1\4\2\uffff\1\2",
            "",
            "",
            "",
            "\1\13\5\uffff\1\14",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
    };

    static final short[] DFA5_eot = DFA.unpackEncodedString(DFA5_eotS);
    static final short[] DFA5_eof = DFA.unpackEncodedString(DFA5_eofS);
    static final char[] DFA5_min = DFA.unpackEncodedStringToUnsignedChars(DFA5_minS);
    static final char[] DFA5_max = DFA.unpackEncodedStringToUnsignedChars(DFA5_maxS);
    static final short[] DFA5_accept = DFA.unpackEncodedString(DFA5_acceptS);
    static final short[] DFA5_special = DFA.unpackEncodedString(DFA5_specialS);
    static final short[][] DFA5_transition;

    static {
        int numStates = DFA5_transitionS.length;
        DFA5_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA5_transition[i] = DFA.unpackEncodedString(DFA5_transitionS[i]);
        }
    }

    class DFA5 extends DFA {

        public DFA5(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 5;
            this.eot = DFA5_eot;
            this.eof = DFA5_eof;
            this.min = DFA5_min;
            this.max = DFA5_max;
            this.accept = DFA5_accept;
            this.special = DFA5_special;
            this.transition = DFA5_transition;
        }
        public String getDescription() {
            return "1:1: Tokens : ( T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | Number | WHITESPACE | NEWLINE );";
        }
    }
 

}